package com.house.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.house.common.utils.PageUtils;
import com.house.common.utils.Query;
import com.house.system.dao.SubwayDao;
import com.house.system.entity.TbSubwayLine;
import com.house.system.service.SubwayService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service
public class SubwayServiceImpl extends ServiceImpl<SubwayDao, TbSubwayLine> implements SubwayService {

    private final SubwayDao subwayDao;

    public SubwayServiceImpl(SubwayDao subwayDao) {
        this.subwayDao = subwayDao;
    }


    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TbSubwayLine> page = this.page(
                new Query<TbSubwayLine>().getPage(params),
                new QueryWrapper<TbSubwayLine>()
        );
        return new PageUtils(page);
    }

    @Override
    public List<TbSubwayLine> findlist(Integer cid) {
        return subwayDao.findlist(cid);
    }

    @Override
    public void saves(TbSubwayLine tbSubwayLine) {
        subwayDao.saves(tbSubwayLine);
    }

    @Override
    public void updateByIds(TbSubwayLine tbSubwayLine) {
        subwayDao.updateByIds(tbSubwayLine);
    }

    @Override
    public void removeByIds(Integer id) {
        subwayDao.removeByIds(id);
    }
}
